home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / mdosp401.zip / DEMO1.C < prev    next >
C/C++ Source or Header  |  1990-10-02  |  952b  |  38 lines

  1. /************/
  2. /* DEMO1.C */
  3. /*********************************************/
  4.  
  5. #include <ctype.h>
  6. #include <stdio.h>
  7. #include <dos.h>
  8.  
  9. union REGS inregs;
  10. union REGS outregs;
  11.  
  12. /****************/
  13. /* main program */
  14. /****************/
  15.  
  16. int main(int argcnt, char *arglst[])
  17. {
  18.     printf("\x01b[2J");  /* ANSI.SYS clear screen */
  19.  
  20.     printf("\x01b[5;5H*** MultiDos Plus DEMO1 Program ***");
  21.     for (;;)
  22.     {
  23.         printf("\x01b[10;10H");        /* position cursor */
  24.         inregs.h.ah = 0x2a;    /* DOS GET DATE function code */
  25.         int86(0x21, &inregs, &outregs);
  26.         outregs.x.cx -= 1900;
  27.         printf("%d/%d/%d", outregs.h.dh, outregs.h.dl, outregs.x.cx);
  28.  
  29.         inregs.h.ah = 0x2c;    /* DOS GET TIME function code */
  30.         int86(0x21, &inregs, &outregs);
  31.         printf(" %d:%2.2d", outregs.h.ch, outregs.h.cl);
  32.         printf(":%2.2d.%2.2d  ", outregs.h.dh, outregs.h.dl);
  33.         
  34.         inregs.h.ah = 0;    /* MultiDos Plus GIVE UP TIMESLICE */
  35.         int86(0x15, &inregs, &outregs);
  36.     }
  37. }
  38.